Trò chơi Tic-Tac-Toe, game đánh caro full source code
53.534 lượt xem;
- ServerTime.cs
- UtilityScripts /
- Photon Unity Networking /
- Assets /
- project /
1 using System;
2 using UnityEngine;
3 using System.Collections;
4
5 public class ServerTime : MonoBehaviour
6 {
7 // Update is called once per frame
8 void OnGUI()
9 {
10 GUILayout.BeginArea(new Rect(Screen.width/2-100, 0, 200,30));
11 GUILayout.Label(string.Format("Time Offset: {0}", PhotonNetwork.networkingPeer.ServerTimeInMilliSeconds - Environment.TickCount));
12 if (GUILayout.Button("fetch"))
13 {
14 PhotonNetwork.FetchServerTimestamp();
15 }
16 GUILayout.EndArea();
17 }
18 }
2 using UnityEngine;
3 using System.Collections;
4
5 public class ServerTime : MonoBehaviour
6 {
7 // Update is called once per frame
8 void OnGUI()
9 {
10 GUILayout.BeginArea(new Rect(Screen.width/2-100, 0, 200,30));
11 GUILayout.Label(string.Format("Time Offset: {0}", PhotonNetwork.networkingPeer.ServerTimeInMilliSeconds - Environment.TickCount));
12 if (GUILayout.Button("fetch"))
13 {
14 PhotonNetwork.FetchServerTimestamp();
15 }
16 GUILayout.EndArea();
17 }
18 }
Update is called once per frame